//
//  ChargeMobilePhoneRequest.m
//  EasyToo
//
//  Created by YuanDee on 13-9-5.
//
//

#import "ChargeMobilePhoneRequest.h"

@implementation ChargeMobilePhoneRequest
-(id)initWithPhoneNum:(NSString*)phoneNum
            andCardId:(NSString*)cardId
         andCardPrice:(NSString*)cardPrice
             Delegate:(id<ServerCommunicationDelegate>)delegate;
{
    self = [super init];
    if(self)
    {
        self.requestName = @"ChargeMobilePhoneRequest";
        self.phoneNum = phoneNum;
        self.cardId = cardId;
        self.delegate = delegate;
        self.url = PROTOCOL_ORDER_URL;
        
        [self.bodyJsonDict setObject:self.phoneNum forKey:@"game_userid" ];
        [self.bodyJsonDict setObject:self.cardId forKey:@"cardid"];
        [self.bodyJsonDict setObject:@"" forKey:@"ret_url"];
        [self.bodyJsonDict setObject:@"" forKey:@"game_srv"];
        [self.bodyJsonDict setObject:@"4.0" forKey:@"version"];
        [self.bodyJsonDict setObject:@"1" forKey:@"cardnum"];
        
        [self.headerJsonDict setObject:@"141303" forKey:@"TranCode"];
        [self.headerJsonDict setObject:cardPrice forKey:@"TxAmt"];
        [self.headerJsonDict setObject:self.phoneNum forKey:@"Contacter"];

        [self buildJsonRequest];
    }
    return self;
}

-(void)dealloc
{
    self.phoneNum = nil;
    self.cardId = nil;
    self.area = nil;
    [super dealloc];
}
@end
